package com.service.impl;

import com.dao.UserLoginDao;
import com.dao.impl.UserLoginDaoImpl;
import com.exception.UserNotFoundException;
import com.pojo.Users;
import com.service.UserLoginService;

import javax.servlet.annotation.WebServlet;


public class UserLoginServiceImpl implements UserLoginService {

    /*
    * 用户登录业务层
    * */
    public Users userLogin(String username, String userpwd) {
        UserLoginDao userLoginDao=new UserLoginDaoImpl();
        Users users = userLoginDao.selectUsersByUserNameAndUserPwd(username, userpwd);
        if (users==null){
            throw new UserNotFoundException("用户名或密码有误!");
        }
        return users;
    }
}
